class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) 
    {
        std::vector<int> result;
        for(int i = 0; i < nums.size(); i++)
        {
            int item = nums[i];
            int other = target - item;
            if(std::find(nums.begin(), nums.end(), other) != nums.end())
            {
                int cnt = std::find(nums.begin(), nums.end(), other) - nums.begin();
                if(cnt != i)
                {
                    result.push_back(cnt);
                    result.push_back(i);
                    break;
                }
            }
        }
        return result;
    }
};